
<!DOCTYPE html>
<html lang="en" class="no-js">

    <head>
        <meta charset="utf-8">
        <title>用户登录界面</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
         <!-- Javascript -->
		 <script src="assets/js/jquery.min.js"></script>
        <script src="assets/js/supersized.3.2.7.min.js"></script>
        <script src="assets/js/supersized-init.js"></script>
        <script src="assets/js/scripts.js"></script>
        <!-- CSS -->
        <link rel='stylesheet' href='http://fonts.googleapis.com/css?family=PT+Sans:400,700'>
        <link rel="stylesheet" href="assets/css/reset.css">
        <link rel="stylesheet" href="assets/css/supersized.css">
        <link rel="stylesheet" href="assets/css/style.css">

        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="page-container">
            <h1>登录页面</h1>
           <div class="register">
                <input type="text" name="username" class="username" placeholder="用户名">
                <input type="password" name="password" class="password" placeholder="密码">
             <!--    <input type="file" name="userphoto" class="username" placeholder="用户头像"> -->
                <button class="login">登录</button>
                <div class="error"><span></span></div>
            </div>
            <div class="connect">
                <p>通过以下方式联系我们:</p>
                <p>
                    <a class="facebook" href=""></a>
                    <a class="twitter" href=""></a>
                </p>
            </div>
        </div>
     
    </body>
	<script>
	$(document).ready(function(){
		$(".login").click(function(){
			var username = $(".username").val();
			var password = $(".password").val();
			$.post("login",{"user.username":username,"user.password":password}, function(data){
				if (data.isSuccess) {
					alert("登录成功")
					window.location.href="index.html";
				} else {
					alert("登录失败")
					window.location.href="login.html";
				}
			})
		})
	})
		</script>
</html>

